using System;
using Microsoft.SPOT;
using dotnetwarrior.NetMF.DL40;
using System.Threading;

namespace DLIOTest
{
    class TestOutputPin
    {
        static DLIOModule Module;
        static IOutputPin Led;
        static bool State = false;
        public static void Run(DLIOModule module)
        {
            Module = module;

            // Create an output pin on the DL40 MCU pin 0.8
            Led = module.CreateOutputPin(0, 8, State);

            Gadgeteer.Timer timer = new Gadgeteer.Timer(1000);
            timer.Tick += new Gadgeteer.Timer.TickEventHandler(timer_Tick);
            timer.Start();
        }

        static void timer_Tick(Gadgeteer.Timer timer)
        {
            State = !State;
            //Led.Write(State);

            Led.Write(!Led.Read());

        }
    }
}
